# Maintainer: Johannes Löthberg <johannes@kyriasis.com>
# Maintainer: Alexander Epaneshnikov <alex19ep@archlinux.org>
# Contributor: Ivan Shapovalov <intelfx@intelfx.name>

pkgname=python-canonicaljson
pkgver=2.0.0
pkgrel=2
pkgdesc='Canonical JSON'
url='https://pypi.python.org/pypi/canonicaljson/'
arch=('any')
license=('Apache')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-wheel' 'python-setuptools')
checkdepends=('python-pytest')
source=("python-canonicaljson-$pkgver.tar.gz::https://github.com/matrix-org/python-canonicaljson/archive/v${pkgver}.tar.gz")
sha512sums=('953426264f231c5c598f7a2212fd566e6b0c51bd766778143283a3b6f7b01627f41d81c2355bacd0dcea9fb6992865092ad798f35a829845be2a9c18cff72a68')
b2sums=('ebaa5d3ef8c83f1f67e5b92951bd42d90639b634e0a154ee57801bf91c710b42e08404ac4ac1934a9cc4dc92e60447fb4153182ae2c9c7e435db44949e8e600c')

build() {
	cd python-canonicaljson-$pkgver
	python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
	cd python-canonicaljson-$pkgver
	python -m venv --system-site-packages test-env
	test-env/bin/python -m installer dist/*.whl
	PATH="$PWD/test-env/bin:$PATH" test-env/bin/python -m pytest
}

package() {
	cd python-canonicaljson-$pkgver
	python -m installer --destdir="$pkgdir" dist/*.whl
}

# vim: set ts=4 sw=4 tw=0 ft=PKGBUILD :
